package model

import "gorm.io/gorm"

type User struct {
	gorm.Model
	Username string `gorm:"type:varchar(30)"`
	Password string `gorm:"type:varchar(32)"`
}

// 用户角色表
type UserRole struct {
	gorm.Model
	Uid int `gorm:"type:int"`
	Rid int `gorm:"type:int"`
}
type Role struct {
	gorm.Model
	RoleName string `gorm:"type:varchar(30)"`
}

// 角色权限表
type RoleNode struct {
	gorm.Model
	Rid int `gorm:"type:int"`
	Nid int `gorm:"type:int"`
}
type Node struct {
	gorm.Model
	NodeName string `gorm:"type:varchar(30)"`
}

// //////////////////////货物仓库需求表
type Repo struct {
	gorm.Model
	RepCode string `gorm:"type:varchar(50)"` //仓库编码
	RepName string `gorm:"type:varchar(50)"` //仓库名称
}
type RepOrder struct {
	gorm.Model
	OrderId    int    `gorm:"type:int"`
	RepId      int    `gorm:"type:int"`         //仓库ID
	OrderCode  string `gorm:"type:varchar(30)"` //订单编码
	GoodNum    int    `gorm:"type:int"`         //商品数量
	OrderPrice int    `gorm:"type:int"`         //订单价格
}
type RepoOrderList struct {
	RepCode    string
	RepName    string
	OrderCode  string
	GoodNum    int
	OrderPrice int
}

// //////////////货物车辆配送订单////////////////
type Car struct {
	gorm.Model
	CarNo   string `gorm:"type:varchar(50)"` //车辆编码
	CarName string `gorm:"type:varchar(50)"` //车辆名称
	CarCode string `gorm:"type:varchar(50)"` //车牌号
}
type CarOrder struct {
	gorm.Model
	OrderNo   string `gorm:"type:varchar(50)"` //订单号
	OrderFrom string `gorm:"type:varchar(50)"` //发货地
	OrderTo   string `gorm:"type:varchar(50)"` //目的地
	OrderGood string `gorm:"type:varchar(50)"` //订单商品
	Cid       int    `gorm:"type:int"`         //车辆ID
}
type CarOrderList struct {
	OrderId   int    `gorm:"type:int"`
	CarNo     string `gorm:"type:varchar(50)"` //车辆编码
	CarName   string `gorm:"type:varchar(50)"` //车辆名称
	CarCode   string `gorm:"type:varchar(50)"` //车牌号
	OrderNo   string `gorm:"type:varchar(50)"` //订单号
	OrderFrom string `gorm:"type:varchar(50)"` //发货地
	OrderTo   string `gorm:"type:varchar(50)"` //目的地
	OrderGood string `gorm:"type:varchar(50)"` //订单商品
}

// /////////商品订单/////////////
type Good struct {
	gorm.Model
	GoodCode string `gorm:"type:varchar(50)"` //商品编码
	GoodName string `gorm:"type:varchar(50)"` //商品名称
}
type GoodOrder struct {
	gorm.Model
	Gid        int    `gorm:"type:int"`         //商品ID
	OrderCode  string `gorm:"type:varchar(50)"` //订单编码
	OrderPrice int    `gorm:"type:int"`         //订单价格
}
type GoodOrderList struct {
	OrderId    int    `gorm:"type:int"`
	GoodCode   string `gorm:"type:varchar(50)"` //商品编码
	GoodName   string `gorm:"type:varchar(50)"` //商品名称
	OrderCode  string `gorm:"type:varchar(50)"` //订单编码
	OrderPrice int    `gorm:"type:int"`         //订单价格
}

// /////配送订单业务/////////
type PerSon struct {
	gorm.Model
	PerCode  string `gorm:"type:varchar(50)"` //配送人员编码
	PerName  string `gorm:"type:varchar(50)"` //配送人员名称
	PerPhone string `gorm:"type:varchar(50)"` //配送人员手机号
}
type PserSonOrder struct {
	gorm.Model
	OrderCode string `gorm:"type:varchar(50)"` //订单编号
	OrderTo   string `gorm:"type:varchar(50)"` //订单配送的地址
	Pid       int    `gorm:"type:int"`         //人员编号
}
type PerSonOrderList struct {
	OrderId   int    `gorm:"type:int"`
	PerCode   string `gorm:"type:varchar(50)"`
	PerName   string `gorm:"type:varchar(50)"`
	PerPhone  string `gorm:"type:varchar(50)"`
	OrderCode string `gorm:"type:varchar(50)"`
	OrderTo   string `gorm:"type:varchar(50)"`
}

// ///////车辆交易订单/////////
type BigCar struct {
	gorm.Model
	CarCode  string `gorm:"type:varchar(50)"`
	CarName  string `gorm:"type:varchar(50)"`
	CarPrice int    `gorm:"type:int"`
}
type BigCarOrder struct {
	gorm.Model
	OrderCode  string `gorm:"type:varchar(30)"`
	OrderPrice int    `gorm:"type:int"`
	Cid        int    `gorm:"type:int"`
}
type BigCarOrderList struct {
	OrderId    int    `gorm:"type:int"`
	CarCode    string `gorm:"type:varchar(50)"`
	CarName    string `gorm:"type:varchar(50)"`
	CarPrice   int    `gorm:"type:int"`
	OrderCode  string `gorm:"type:varchar(30)"`
	OrderPrice int    `gorm:"type:int"`
}
